package org.barad.architecture.analyzer.widgets;

import javax.swing.JTextField;
import javax.swing.JTree;

import org.barad.architecture.analyzer.model.impl.Specification;


public class CustomJTextField extends JTextField {
	public static final long serialVersionUID = 1L;
	private JTree tree;
	private CustomMutableTreeNode node;
	
	public CustomJTextField(JTree tree, CustomMutableTreeNode node) {
		this.tree = tree;
		this.setNode(node);
	}
	
	public CustomMutableTreeNode getNode() {
		return node;
	}
	
	public void setNode(CustomMutableTreeNode node) {
		this.node = node;
		Specification specification = (Specification)node.getUserObject();
		setText(specification.getName());
	}

	public JTree getTree() {
		return tree;
	}

	public void setTree(JTree tree) {
		this.tree = tree;
	}
}
